import request from '@/utils/request'
import { getServicePath } from '@/api/baseUrlConfig'
const servicePath = getServicePath()

// 查询党章党规分类树
export function tree (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/typeTreeList`,
    method: 'get',
    params: data
  })
}

// 新增党章党规分类
export function treeAdd (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/typeAdd`,
    method: 'post',
    data
  })
}

// 编辑党章党规分类
export function treeEdit (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/typeUpdate`,
    method: 'post',
    data
  })
}

// 删除党章党规分类
export function treeDelete (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/deleteTypeById/${data.id}`,
    method: 'get',
    params: data
  })
}

// 查询党章党规列表
export function queryByCondition (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/list`,
    method: 'get',
    params: data
  })
}

// 新增党章党规
export function add (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/add`,
    method: 'post',
    data
  })
}

// 编辑党章党规
export function edit (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/edit`,
    method: 'post',
    data
  })
}

// 删除党章党规
export function deleteById (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-constitution-regulations/deleteById/${data.id}`,
    method: 'get',
    params: data
  })
}
